﻿#include "widget.h"
#include "ui_widget.h"
#include "../../CatTools/CatNetWorks/CatHttpTools.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    m_pCatHttpTools = new CatHttpTools(this);
    connect(m_pCatHttpTools, &CatHttpTools::DownLoadProgress, this, [=](qint64 x, qint64 y){
        ui->progressBar->setMaximum(y);
        ui->progressBar->setValue(x);
    });
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    m_pCatHttpTools->DownLoad(ui->lineEdit->text());
}
